package com.zeta.eduservice.service.impl;

import com.zeta.eduservice.entity.EduCreateFile;
import com.zeta.eduservice.entity.vo.CreatePaperType;
import com.zeta.eduservice.entity.vo.CreatePaperType.WeekDay;
import com.zeta.eduservice.entity.vo.front.ChapterCourseDetialVo;
import com.zeta.eduservice.entity.vo.front.PdfQuestionVo;
import com.zeta.eduservice.entity.vo.front.QuestionCreateInfo;
import com.zeta.eduservice.entity.vo.front.front.PaperInfoVo;
import com.zeta.eduservice.mapper.EduCreatePdfMapper;
import com.zeta.eduservice.service.EduCreatePdfService;
import com.zeta.eduservice.service.EduQuestionService;
import com.zeta.eduservice.utils.pdf.PdfUtils;
import com.zeta.eduservice.utils.word.Load;
import com.zeta.eduservice.utils.word.Wordload;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itextpdf.text.DocumentException;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.EnumSet;
import java.util.List;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 生成习题pdf 服务实现类
 * </p>
 *
 * @author zeta
 * @since 2020-10-14
 */
@Service
public class EduCreatePdfServiceImpl extends ServiceImpl<EduCreatePdfMapper, EduCreateFile> implements EduCreatePdfService {

	@Autowired
	Wordload wordUtils;
	@Autowired
	PdfUtils pdfUtils;
	@Autowired
	private EduQuestionService questionService;
	@Override
	public void create(EduCreateFile eduCreatePdf, String pdfDownloadPath) throws IOException {
//		baseMapper.insert(eduCreatePdf);
////		List<PdfQuestionVo> getsPdfByfolderId = questionService.getsPdfByfolderId(eduCreatePdf.getFolderId());
//		try {
//			//pdfUtils.creatPdf(pdfDownloadPath,getsPdfByfolderId);
//		} catch (FileNotFoundException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (DocumentException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		
	}


	@Override
	public void createCourseWord(EduCreateFile eduCreatePdf, List<QuestionCreateInfo> javaList, String pdfDownloadPath,
			PaperInfoVo paperInfo, List<ChapterCourseDetialVo> chapterList, Integer integer) throws IOException, InvalidFormatException {
//		baseMapper.insert(eduCreatePdf);
//		wordUtils.CreatePaper2(pdfDownloadPath, javaList, paperInfo,chapterList,integer);
//		
	}
	
	@Override
	public void createCoursePaperWord(EduCreateFile eduCreatePdf, String pdfDownloadPath,
			PaperInfoVo paperInfo,CreatePaperType papercreateType) throws IOException, InvalidFormatException {

		wordUtils.CreatePaperWord(pdfDownloadPath,paperInfo,papercreateType);
		
	}
	
	

}
